package com.alks.function.data.vo.stock;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.converters.localdate.LocalDateDateConverter;
import com.alks.common.utils.excelUtils.nestExcel.annotation.NestExcelCollection;
import com.alks.common.utils.excelUtils.nestExcel.annotation.NestExcelEntity;
import com.alks.common.utils.excelUtils.nestExcel.annotation.NestExcelProperty;
import com.alks.common.utils.excelUtils.nestExcel.convert.DateConvert;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author: chen
 * @date: 2024/11/14
 * @description: 成品收发入库明细报表VO
 */
@Data
@ApiModel(value = "成品收发入库明细报表VO")
@NoArgsConstructor
@AllArgsConstructor
public class ReportStockInVO {

    @NestExcelProperty(name = "线别")
    private String line;

    @NestExcelCollection(name = "明细")
    private List<OrderVO> details;

    @Data
    public static class OrderVO {

        public OrderVO() {
        }

        public OrderVO(Integer qty) {
            this.qty = qty;
        }

        @NestExcelProperty(name = "指令")
        private String lotNo;

        @NestExcelProperty(name = "品牌")
        private String custom;

        @NestExcelProperty(name = "订单数")
        private Integer orderQty;

        @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
        @NestExcelProperty(name = "下单日期")
        @ExcelProperty(converter = DateConvert.class)
        private LocalDateTime orderDate;

        @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
        @NestExcelProperty(name = "客户交期")
        @ExcelProperty(converter = DateConvert.class)
        private LocalDateTime deliveryDate;

        @NestExcelProperty(name = "当期入库")
        private Integer qty;

        @NestExcelProperty(name = "累计入库")
        private Integer pairInQty;

        @NestExcelProperty(name = "入库欠数")
        private Integer inOweQty;

    }
}
